import csv

def save_to_csv(addresses, output_file):
    """将收集到的地址保存到CSV文件"""
    try:
        with open(output_file, 'w', newline='', encoding='utf-8') as csvfile:
            writer = csv.writer(csvfile)
            # 写入表头
            writer.writerow(['Address', 'Type'])
            # 写入数据
            writer.writerows(addresses)
    except Exception as e:
        print(f"保存CSV文件时出错: {e}")    